package com.rabbitmq.demo.listener;

import com.rabbitmq.demo.conf.SimpleQueueConfig;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;

/**
 * 简单模式消费者
 * SimpleQueue
 * @Author yi.cheng
 * @Date 2023-7-11 17:33
 **/
@Slf4j
@Component
public class SimpleQueueConsumer {

    @RabbitListener(queues = SimpleQueueConfig.SIMPLE_QUEUE_NAME)
    public void getSimpleQueueMessage(String message){
        log.info("简单模式消费者消费了：{}，消费时间:{}",message, LocalDateTime.now());
    }
}
